package vip.meeet.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.support.ConversionServiceFactoryBean;
import org.springframework.core.convert.converter.Converter;
import vip.meeet.conversion.StringToDateConvert;

import java.util.HashSet;

@Configuration
@ImportResource({
        "classpath:spring-date.xml"
})
public class ConversionServiceConfig {

//    @Bean
//    public StringToDateConversionService getStringToDateConversionService(){
//        ConversionServiceFactoryBean conversionServiceFactoryBean = new ConversionServiceFactoryBean();
//        conversionServiceFactoryBean.set
//        return new StringToDateConversionService();
//    }

    @Bean
    public ConversionServiceFactoryBean getStringToDateConvert(){
        ConversionServiceFactoryBean conversionServiceFactoryBean = new ConversionServiceFactoryBean();
        HashSet<Converter> set = new HashSet<>();
        StringToDateConvert stringToDateConvert = new StringToDateConvert();
        set.add(stringToDateConvert);
        return conversionServiceFactoryBean;
    }

}
